package gui;

import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JComponent;
import javax.swing.JProgressBar;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.border.BevelBorder;
import javax.swing.border.Border;
import javax.swing.border.LineBorder;
import javax.swing.border.SoftBevelBorder;
import javax.swing.plaf.metal.MetalTabbedPaneUI.TabbedPaneLayout;

import java.awt.Component;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;

import javax.swing.JButton;

import observer.Broker;

public class LeftPanel extends JPanel{

	private static final long serialVersionUID = 1L;
	private JTabbedPane tabbedPane;
	private Broker broker;

	public LeftPanel(Broker broker) {
		
		this.broker = broker;
		
		tabbedPane = new JTabbedPane();
		
		this.setPreferredSize(new Dimension(250, 600));
		setBorder(new LineBorder(new Color(0, 0, 0), 2, true));
		
		//homeImg = new ImageIcon("img/home.gif");
		
		GeneralPanel generalPanel = new GeneralPanel(this.broker);
		
		tabbedPane.addTab("Genenrale", null, generalPanel);
		tabbedPane.setMnemonicAt(0, KeyEvent.VK_G);
		
		//pannelli temporanei che devo essere implementati come "PanelGeneral"
		JPanel statisticheGenerali = new JPanel();
		tabbedPane.addTab("Stat generali", null, statisticheGenerali);
		tabbedPane.setMnemonicAt(1, KeyEvent.VK_S);
		
		//pannelli temporanei che devo essere implementati come "PanelGeneral"
		StatistichePanel statisticheAuto = new StatistichePanel(this.broker);
		tabbedPane.addTab("Stat auto", null, statisticheAuto);
		tabbedPane.setMnemonicAt(1, KeyEvent.VK_P);
		
		JPanel altro = new JPanel();
		tabbedPane.addTab("Varie ed eventuali", null, altro);
		tabbedPane.setMnemonicAt(2, KeyEvent.VK_0);
				
		this.add(tabbedPane);
	}
	
	
}
